-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RISC-V] Disable EnableWriteXorExecute by default on riscv64 architectue #103408
Conversation
On riscv64 architectue any dotnet process that loads corossgened assembly without DOTNET_EnableWriteXorExecute=0 environment variable set crashes with "Segmentation fault" error. For example System.Private.CoreLib.dll is compiled with crossgen2 by default during build phase so this crash applies to any processes that loads it. Setting EnableWriteXorExecute=0 disables this options on riscv64 architecure and prevents these crashes. Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
These crashes occur on both QEMU and VisionFive2 board. |
Is this crash a bug that should be fixed? |
Yes, it is a bug. On Now, before we start any dotnet process that loads a crossgened assembly we need to disable W^X by exporting What's more, there are some corefx tests that spawn child process with an empty environment ( That's why we need that W^X functionality to be disabled by default in runtime configuration for Of course when W^X gets correctly handled on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@rzsc what is the memory page size on the devices where it crashes? And do you happen to know where the crash occurs? |
No, sorry. I cannot answer your questions because I'm not familiar with this crossgen2 vs W^X problem. What I'm trying to accomplish here is to move the mechanism of disabling W^X on Thank you. |
RISC-V test results for qemu-prio1-checked (
|
RISC-V test results for starfive-prio1-checked (
|
This test was failing before PR changes. We are aware of it and working on it. |
Why are the corefx tests not passing with env variable? Is it the same problem #100505 by any chance? It would be better to fix that instead. If you would like to disable |
…rch. Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Yes, this is the same problem as in #100505.
Yes, it sounds like a good idea. Thank you. |
RISC-V test results for qemu-prio1-checked (
|
RISC-V test results for starfive-prio1-checked (
|
On riscv64 architectue any dotnet process that loads corossgened assembly without DOTNET_EnableWriteXorExecute=0 environment variable set crashes with "Segmentation fault" error.
For example System.Private.CoreLib.dll is compiled with crossgen2 by default during build phase so this crash applies to any processes that loads it.
Setting EnableWriteXorExecute=0 disables this options on riscv64 architecure and prevents these crashes.
Co-authored-by: Dong-Heon Jung clamp03@gmail.com
Part of #84834, cc @dotnet/samsung